Dynamic application placement based on cost and availability of energy in datacenters

ABSTRACT

An optimization framework for hosting sites that dynamically places application instances across multiple hosting sites based on the energy cost and availability of energy at these sites, application SLAs (service level agreements), and cost of network bandwidth between sites, just to name a few. The framework leverages a global network of hosting sites, possibly co-located with renewable and non-renewable energy sources, to dynamically determine the best datacenter (site) suited to place application instances to handle incoming workload at a given point in time. Application instances can be moved between datacenters subject to energy availability and dynamic power pricing, for example, which can vary hourly in day-ahead markets and in a time span of minutes in realtime markets.

BACKGROUND

Energy costs are rising as systems scale up and becoming an increasingly larger fraction of running datacenters, accounting for up to a substantial portion of the total expenditure and amounting to tens of millions of dollars per annum. To reduce these costs, efforts are being made in two different directions to combine traditional grid power (e.g., electric grid) and backup power (e.g., UPS and diesel generators) with renewable energy sources (e.g., solar, wave, tidal, and wind), and to exploit the variation of electricity prices both temporally and geographically (e.g., utility prices can change across different regions and even across the same region, based on diurnal patterns—peak and off-peak periods—or even significantly over a window of 5-15 minutes across the country).

SUMMARY

The following presents a simplified summary in order to provide a basic understanding of some novel embodiments described herein. This summary is not an extensive overview, and it is not intended to identify key/critical elements or to delineate the scope thereof. Its sole purpose is to present some concepts in a simplified form as a prelude to the more detailed description that is presented later.

The disclosed architecture is an optimization framework that dynamically places application instances across multiple hosting sites (e.g., datacenters) based on the energy cost and availability of energy at these sites, application SLAs (service level agreements), availability of compute elements at hosting sites, and cost of network bandwidth between sites, just to name a few considerations. Existing cloud computing infrastructures can now employ the optimization framework and realize significant economic gains.

The architecture leverages a global network of hosting sites, possibly co-located with renewable and non-renewable energy sources, to dynamically determine the best datacenter (site) suited to place application instances to handle incoming workload at a given point in time, in order to minimize the total cost of running the requisite set of application instances across the hosting sites. Application instances can be moved between datacenters subject to energy availability and dynamic power pricing in a multi-electricity market environment, for example, which can vary hourly in day-ahead markets and in a time span of minutes in realtime markets.

The architecture is a closed-loop control system for dynamic application placement that is integrated with a reliable language runtime mechanism to transparently migrate application instances between datacenters, resulting in cutting the energy costs for operating datacenters. A decision component reasons over the hosting sites data and outputs power optimization decisions associated with the hosting sites. An application placement component automatically relocates application instances between hosting sites based on the power optimization decisions.

To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings. These aspects are indicative of the various ways in which the principles disclosed herein can be practiced and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. Other advantages and novel features will become apparent from the following detailed description when considered in conjunction with the drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an optimization system in accordance with the disclosed architecture.

FIG. 2 illustrates an alternative embodiment of a system that includes a learning component that learns about hosting site information, a simulator, and a decision component.

FIG. 3 illustrates a hosting sites model that can be employed for the optimization framework.

FIG. 4 illustrates an application instances model that can be employed for the optimization framework.

FIG. 5 illustrates a sorted sequence of power sources based on end time of source power availability.

FIG. 6 illustrates an algorithm that computes optimum partition intervals.

FIG. 7 illustrates that each power source may have different start and end times of availability for power pricing.

FIG. 8 illustrates an intelligent power control system for the hosting site.

FIG. 9 illustrates a computer-implemented optimization method in accordance with the disclosed architecture.

FIG. 10 illustrates further aspects of the method of FIG. 9.

FIG. 11 illustrates further aspects of the method of FIG. 9.

FIG. 12 illustrates a block diagram of a computing system that executes the optimization framework in accordance with the disclosed architecture.

FIG. 13 illustrates a schematic block diagram of a computing environment that performs optimization in accordance with the disclosed architecture.

DETAILED DESCRIPTION

The disclosed optimization architecture leverages a global network of datacenters (also referred to as hosting sites), possibly co-located with renewable (and non-renewable) energy sources, to dynamically determine the best hosting location (e.g., a computer, a rack, a “colo” (co-location—multiple customer usage of single datacenter), a container, a datacenter, etc.) suited to place (or schedule) application instances at a given point in time. For example, applications may be interactive to handle user requests, or batch applications that process data or perform computations. The optimization framework provides the capability to move application instances between datacenters subject to energy availability and dynamic power pricing, which can vary (a) temporally: hourly in day-ahead markets and in a time span of five minutes in realtime markets, and (b) geographically: pricing variation in different regional markets, even when nearby, and even across locations in the same region. The pricing variation arises due to several factors such as regional demand differences, transmission inefficiencies, and generation diversity. To make decisions on application migration, the framework also takes into account dynamic availability of datacenter equipment due to factors such as power failures or server failures.

The disclosed architecture includes control system for dynamic application placement integrated with a reliable language runtime mechanism (e.g., a programming model for applications implemented as “grains/silos” (stateless, light-weight processes) that enables transparent code mobility) and/or run as an infrastructure service co-located with hosting virtual machines (VMs) to transparently migrate application instances hosted in VMs between datacenters (without impacting the end user), thereby cutting the electric costs for operating datacenters. Measurement tools can be employed to measure the dynamic power footprint of hosted application instances (or hosting VMs).

A general algorithm for dynamic application placement is described as follows: formulate the problem according to the system model described herein, and obtain the current values of the different parameters in the framework (either offline or in an online manner as needed), where realtime monitoring of application QoS (quality of service) and performance counters may also be performed. These values are fed into the optimization framework (which can run on a central controller machine in the datacenter), and solved to compute the optimal placement of application instances across different hosting locations (sites) based on cost and availability of energy as well as the availability of hosting compute elements, among other factors such as bandwidth cost and latency for migrating application instances between sites. These decisions are then actuated to migrate application instances from the current placement to the optimal placement. The optimization problem is solved with a fixed periodicity or on-demand.

The actuation of migrating application instances may also be integrated with request redirection of incoming user requests that can be performed transparently (e.g., via domain name service (DNS) redirection), and replication of application-state and user-data at different hosting sites.

Regarding where the optimization framework is executed, a central facility or a distributed set of machines may monitor execution of applications and hosting site and application instance models, perform software probes, and disseminate and check execution of migration decisions, among other functions.

Note that the algorithm can complement other closed-loop control frameworks for managing pools of resources (e.g., servers) in a datacenter. For example, in one approach, given a large number of servers hosting cloud applications in a datacenter, this approach aims to maximize the energy savings of operating these computers by only running the optimal number of servers needed to process the input workload under given service-level agreement (SLAs), while keeping remaining servers in low-power states (e.g., ACPI (advanced configuration and power interface) performance and sleep states such as sleep, hibernate) or in a shutdown mode to save energy.

Reference is now made to the drawings, wherein like reference numerals are used to refer to like elements throughout. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding thereof. It may be evident, however, that the novel embodiments can be practiced without these specific details. In other instances, well known structures and devices are shown in block diagram form in order to facilitate a description thereof. The intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the claimed subject matter.

FIG. 1 illustrates an optimization system 100 in accordance with the disclosed architecture. The system 100 includes multiple hosting sites 102 that run application instances to handle workload. For example, a first hosting site 104 includes first application instances 106, a second hosting site 108 includes second application instances 110, and a third hosting site 112 includes third application instances 114. Each of the hosting sites 102 operate according to realtime energy parameters 116, availability and pricing of energy sources 118, and available computing elements 120. An application placement component 122 automatically relocates application instances between hosting sites based on changes in the energy parameters, the availability of the energy sources, and the availability of the computing elements, among other factors such as cost of application migration.

As described in greater detail herein, the hosting sites 102 are modeled according to one or more of hosting capacity, energy available per source per site at a specific time in terms of watt power intensity and duration, energy cost per source per site at the specific time for each of different available sources of energy, network latency between sites, bandwidth capacity between sites, bandwidth cost per byte between sites, available renewable and non-renewable energy sources, temperature per site, and temperature threshold for each site. One or more of the above data points can be output every configured time interval for consumption by a decision engine (described below).

The application instances (106, 110, and 114) are modeled according to one or more of CPU usage per instance, memory footprint size per instance, number of network connections maintained by an instance, power footprint per instance, SLAs on hosting of application instances, and latency threshold for migrating an instance between two sites.

The availability of an energy source is computed based on at least one of predicted power per site for a specific time, predicted time until which energy is available per site for a specific time, energy per watt-hour cost per site for a specific time, or energy (power) used per site during intervals in a time window, among other factors. The application placement component may relocate application instances based on results of a simulator model. The application placement component 122 makes decisions based on minimizing energy cost and bandwidth cost per migration, meeting service level agreement requirements during the migration or including latency information in computation of cost.

FIG. 2 illustrates an alternative embodiment of a system 200 that includes a learning component 202 that learns about hosting site information, a simulator 204, and a decision component 206. The learning component 202 learns information of the availability of an energy source based on historical energy availability data and future event notifications, for example. The learned information is applied to enhance the prediction power cost and variation in pricing, availability, time until which power is available per site, and at a specific time.

The system 200 includes the multiple hosting sites 102 that run application instances to handle workload. The hosting sites 102 are managed according to data that includes realtime energy parameters, availability of renewable and non-renewable energy sources, and available computing elements. The decision component 206 reasons over the data and outputs power optimization decisions associated with the hosting sites 102. The decision component 206 can receive as inputs the parameters associated with a hosting model 208 (described in FIG. 3) and the parameters associated with an application instance model 210 (described in FIG. 4). The decision component 206 can also receive as inputs a location energy model 212, client geographic location (geolocation) information 214, and topology information of the hosting sites 216. The location energy model 212 estimates power consumption at a location as a function of number of active servers, server utilization, type and number of hosted applications, and infrastructure parameters, among other factors. The application placement component 122 automatically relocates application instances between hosting sites based on the power optimization decisions.

A prediction model can be employed based on electricity grid data as well as weather differentials and climate historical data available from weather services such as NASA (North American Space Administration) and NCAR (National Center for Atmospheric Research) to predict availability of different energy sources such as solar (e.g., intensity, time of day) and wind (e.g., intensity, direction) as used in the framework. The learning component 202 can utilize the data from the prediction model as well as the national agencies to provide additional learning information.

The simulator 204 can be built to use historical data and make predictions on availability of different energy sources. Further, the simulator model itself can be used to install/place generators of renewable energy at different geographic locations that will yield the maximum energy output per monetary cost and take into consideration other factors such as land availability and pricing, taxes, network connectivity, etc.

Put another way, an optimization system 200 is provided that comprises multiple hosting sites that run application instances to handle workload, the hosting sites are managed according to data that includes realtime energy parameters, availability of renewable and non-renewable energy sources, and available computing elements, the decision component that reasons over the data and outputs power optimization decisions associated with the hosting sites, and the application placement component that automatically relocates application instances between hosting sites based on the power optimization decisions.

The decision component reasons over data that includes at least one of hosting capacity, energy available in terms of power intensity and duration and price per site at a specific time, total energy cost per site at the specific time, network latency between sites, bandwidth capacity between sites, bandwidth cost per byte between sites, available renewable and non-renewable energy sources, length of partition intervals at the specific time, availability of hosting compute elements at different sites, temperature per site, or temperature threshold for each site.

The optimization decisions are based on at least one of minimizing monetary costs, minimizing impact on user interactiveness, maximizing longterm availability, maximizing use of renewable resources, minimizing carbon footprint and pollutant emission due to electricity generation and environmental impact, or balancing bandwidth cost and energy cost.

The decision component reasons over the data that includes application instance information related to at least one of CPU usage and memory footprint size per instance, number of network connections maintained by an instance, power footprint per instance, SLAs on hosting of application instances, or latency threshold for migrating an instance between two sites.

The system 200 can further comprise the learning component that learns information of the availability and price of an energy source based on historical energy availability and pricing data and future event notifications, the learned information applied to enhance a prediction time, power intensity, and energy cost until which power is available and its cost per site at a specific time.

Regarding learning component, it may also provide functionality of learning failure patterns of hosting compute elements from historical data and future event notifications so that the learned information can be used in the decision component 206.

FIG. 3 illustrates the hosting sites model 208 that can be employed for the optimization framework. The optimization is run at a time instant t and at a periodicity τ (e.g., seconds, minutes, or hours). For ease of explanation, the following assumptions on energy availability are made: the fixed power availability (intensity and time duration) and fixed energy cost for each source is known from time instant t to t+τ; and, each energy source is available at time instant t and the energy source availability may expire before time interval τ, but is available at most once from time t to t+τ.

The hosting sites model 208 can include the following:

a model item 302 that denotes the set of hosting locations: 1, . . . , N;

a model item 304 that denotes hosting capacity per site: H_(i)(# instances), iεN;

-   -   (Note that the hosting capacity of each site can depend on the         number of servers available at that site, network constraints         such as topology, bisection bandwidth and over-subscription,         application constraints such as CPU, memory, I/O footprint of         instances (virtual machines (VMs) or grains/silos),         business/legal constraints such as a user-centric data can only         be hosted in a specific geographic location (e.g., European         Union data cannot be hosted in the United States and vice         versa), and, failure characteristics of hardware and software,         among other factors.)

a model item 306 that denotes power available per energy source, from which derives (computed from variables) energy available per location at time t: E_(i)(t) (Watt-hour or Watt-second), iεN;

a model item 308 that denotes cost per energy source, from which derives (computed from variables) total energy cost per location at time t: EC_(i)(t) ($), iεN;

a model item 310 that denotes network latency between locations: L_(i,k) (seconds), i, kεN;

a model item 312 that denotes bandwidth capacity between locations: B_(i,k) (Bps), i, kεN;

a model item 314 that denotes bandwidth cost per byte between locations: BC_(i,k) ($/Byte), i, kεN;

a model item 316 that denotes a set of available energy (renewable and non-renewable) sources: 1, . . . , |Q|

(Note that the number of intervals in the τ window is at most |Q|, but equality can be used by making some interval lengths to zero. The intuition is that an interval boundary is set when an energy source becomes unavailable (end time T_(i,q)) in the τ window. In each such interval, all parameters: power P_(i,q), availability T_(i,q) and power pricing EC_(i,q) are constant. Hence, the number of boundaries would be at most |Q|. Further, this setting helps in computing the length of these intervals a priori. The assumption here is that each power source is available from start time of τ window and will appear only once in that window.);

-   -   For source qεQ, predicted power available per location at time         t: P_(i,q)(t) (Watt), iεN;     -   For source qεQ, predicted time until which power is available         per location at time t: T_(i,q)(t), iαN (Note that the         assumptions here are that the energy source q is available with         constant power P_(i,q)(t) at cost EC_(i,q)(t) from t until         T_(i,q)+t. Assumptions such as fixed power, fixed price, and         availability starting time t are removed later.);     -   For source qεQ, energy cost per Watt-hour per location at time         t:         -   EC_(i,q)(t) ($/Watt-hour), iεN; and     -   (Variable) For source qεQ, power used per location during each         of m intervals in the time window τ: u_(i,q,m)(t) (Watt), iεN,         mε1, . . . |Q|;

a model item 318 (variable) that denotes the length of each of the m partitioning intervals of the time window τ: d_(i,m)(t) (seconds), mε1, . . . , |Q| (the interval τ is partitioned into |Q| (i.e., number of available energy sources) intervals and in each interval, the decision component 206 uses u_(i,q,m)(t) power from source q at site i; Σ_(m=1) ^(|Q|)d_(i,m)=τ;

a model item 320 that denotes temperature per site at time t: θ_(i)(t) (degrees F or C), iεN;

a model item 322 that denotes a temperature threshold of running each site: Θ_(i)(degrees F or C), iεN; and,

a model item 324 that denotes availability of hosting compute elements.

Note that the prediction times, T_(i,q), power P_(i,q), and power pricing EC_(i,q) for qεQ, for different energy sources such as solar, tidal, wind, grid, backup, etc., can be learned (in offline and/or online manner) from past history of power availability and future event notifications using the learning component 202. Further, each of these terms are set to be the minimum of corresponding predicted time of itself (T_(i,q)) and time interval τ, since the framework looks ahead for the next interval τ time to minimize the cost function.

The look-ahead may not be done beyond τ (e.g., to support instance migrations with large data footprint) as most migrations are expected to be for interactive, light-weight instances that can be quickly transferred, whereas instances using large amounts of persistent state can be transferred offline, moved to one of the data replica locations (obviating the need to transfer hard state), be pinned to the original data location, or use an external highly-available, replicated storage service which does not require the transfer of persistent data.

Note that E_(i)(t) may be fixed over the time interval τ or it may vary due to dynamic pricing at fine time granularities (e.g., 5-min fluctuations in realtime or spot markets); in the latter case, compute Ei(t) based on weighing energy prices by the time duration the prices remain constant and averaged over the total time interval τ.

The terms for available energy E_(i)(t) and energy cost EC_(i)(t) at time t are computed as follows (Note that the product of two variables, u_(i,q,m)(t)*d_(i,m)(t), will make the optimization problem non-linear; one approach is to use a Lagrange multipliers method; however, the problem can be converted back to linear by determining the values of d_(i,m)(t) a priori before solving the optimization problem.):

E _(i)(t)=Σ_(m=1) ^(|Q|)(Σ_(qεQ) u _(i,q,m)(t))*d _(i,m)(t)  (1)

EC _(i)(t)=Σ_(m=1) ^(|Q|)(Σ_(qεQ) u _(i,q,m)(t)*EC _(i,q)(t))*d _(i,m)(t)  (2)

The equations (1) and (2) denote the total energy available and the total energy cost at time t at hosting location i powered by different sources of energy. Note that the availability and pricing of a given energy source may change dramatically over a short period of time.

FIG. 4 illustrates the application instances model 210 that can be employed for the optimization framework. The model 210 can be hosted to include the following:

a model item 402 that denotes the set of application instances: 1, . . . , J;

a model item 404 that denotes the memory footprint size per application instance: s_(j) (Bytes) ∀jεJ;

a model item 406 that denotes the number of network connections maintained by application instance: c_(j) (number) ∀jεJ;

a model item 408 that denotes the power footprint (measured using tools such as Joulemeter) per application instance: p_(j) (Watt) ∀jεJ;

a model item 410 that denotes the latency SLA (service level agreement) threshold for migrating an application instance between two locations: Lat^(SLA) (secs);

a model item 412 that denotes the CPU usage per application instance; and

a model item 414 that denotes application-level SLAs.

The s_(j) term primarily includes soft state of an instance loaded in memory. For grains using hard state, either, (1) migrated grains (e.g., for interactive applications) will use an external replicated persistent store, (2) a replicated instance is brought on-line (by recreating state if needed) on the new location and then the original instance is shutdown, or (3) grains (e.g., MapReduce jobs) can be pinned to host locations storing hard state in order to leverage data locality. The s_(j) and p_(j) costs can be measured offline using profiling or learned in an online manner during the application execution; profiling may include both peak and average loads.

The objective function is to minimize the total energy bill for running application instances as well as the bandwidth and latency costs incurred in migrating the instances. The “knobs” available for this optimization are placement of application instances on different hosting locations. Note that some instances may be pinned to only execute at a particular location, for example, user data and application placement based on legal regulations in Europe or Asia, compatibility of hosting platform (e.g., operating system, VM environment) with applications, application priority, etc. This constraint can be modeled as setting constraints λ_(i,j)=0 (described below) for all i locations, where instance j cannot run.

Application placement (the pinning of application instances or operators to locations) can be encoded using a set of indicator variables λ_(i,j)ε{0,1} ∀iεN, ∀jεJ, i.e.,

$\begin{matrix} {\lambda_{i,j} = \left\{ \begin{matrix} {1,} & {{if}\mspace{14mu} j\mspace{14mu} {is}\mspace{14mu} {assigned}\text{/}{pinned}\mspace{14mu} {to}\mspace{14mu} {location}\mspace{14mu} i} \\ {0,} & {otherwise} \end{matrix} \right.} & (3) \end{matrix}$

Similarly, define u_(i,j) to denote initial placement of application instances.

$u_{i,j} = \left\{ \begin{matrix} {1,} & {{if}\mspace{14mu} j\mspace{14mu} {is}\mspace{14mu} {currently}\mspace{20mu} {assigned}\text{/}{pinned}\mspace{14mu} {to}\mspace{14mu} {location}\mspace{14mu} i} \\ {0,} & {otherwise} \end{matrix} \right.$

The solution of the problem computes the values of λ_(i,j) and u_(i,q,m)(t), which in turn determine the migration (i.e., current placement u_(i,j)≠optimal placement λ_(i,j)) and decisions to shutdown servers (e.g., when E_(i)(t) is below a threshold, or site i has zero instances running).

Application Instance Constraint. An application instance (running replicated instances is equivalent to naming the instances uniquely as individual instances) is constrained to only run at a single location across all hosting sites,

∀jεJ:Σ _(iεN)λ_(i,j)=1  (4)

Hosting Capacity Constraint. Similarly, the number of instances that can be hosted at a single site is constrained to the site capacity,

∀iεN:Σ _(jεJ)λ_(i,j) ≦H _(i)  (5)

Note that the hosting term can include multiple factors such as load balancing, power provisioning, physical location, proximity to users, etc. (In the general case, CPU, memory, I/O (e.g., disk, network) footprint of each instance can be included in the hosting capacity constraint,

∀iεN:Σ _(jεJ)λ_(i,j)*footprint(cpu_(j),mem_(j),I/O_(j))≦H _(i)

where H_(i) can be a resource vector comprising CPU, memory, and I/O dimensions considered individually to satisfy the capacity constraint in each dimension or as an aggregate.

Business/Legal Data Constraint. Business/legal constraints can dictate that data and applications accessing the data corresponding to users in one location cannot be placed in other geographic locations. This constraint can be modeled by setting the indicator variables for all instances j that cannot be located at locations i, to zero,

∀iεN,∀jεJ that cannot be hosted at loc i:λ _(i,j)=0

Energy Capacity Constraint. Next, model the energy constraint of hosting application instances at a site (demand equals supply),

∀iεN:Σ _(jεJ)λ_(i,j) *p _(j) *τ=E _(i)(t)  (7)

Migration Latency Constraint. Similarly, the latency constraint on migrating (migration is feasible if below the SLA latency threshold) an application instance can be modeled as:

∀jεJ,∀iεN,∀kεN,i≠k: μ _(i,j)*λ_(k,j) *f(s _(j) ,c _(j) ,i,k)≦Lat ^(SLA)  (8)

The term (u_(i,j)*λ_(k,j)) evaluates to one when instance j is moved from location i to k incurring the bandwidth and latency migration cost, and to zero, otherwise. The function ƒ to compute migration latency is described in terms of the amount of state to be migrated (memory footprint size of the instance), the number of network connections that need to be re-established on migration, and a fixed constant overhead. A simple linear function suffices,

$\begin{matrix} {{f\left( {s_{j},c_{j},i,k} \right)} = {{\eta_{1}*c_{j}} + {\eta_{2}*\frac{s_{j}}{B_{i,k}}} + \eta_{3}}} & (9) \end{matrix}$

where η₁ is a constant to denote time latency per connection re-establishment, η₂ is a multiplicative constant to denote overhead time for network communication, and η₃ is a fixed constant overhead of network migration of an application instance.

Note that the term s_(j)/B_(i,k) is a first-order approximates latency which may increase if the network becomes congested due to many migrations or if the bandwidth capacity gets reduced. However, this term is a good approximation for two reasons. First, the inter-DC (datacenter) bandwidths are roughly of the order of 400+ Mbps, whereas live objects/applications are expected to be tens to hundreds of KBs. Thus, several thousands of objects can be migrated at any time. Further, the inter-DC bandwidth capacities are massively over-provisioned compared to the current usage. Second, the objective function includes a bandwidth term as a weighted cost to be minimized where the weight is based on amortized costs/cost-benefit analysis (e.g., pay bandwidth cost of migration if the new location can yield 10× power savings). Hence, it is expected that there will not be too many migrations unless power prices fluctuate significantly.

Note also that setting up a new connection may be significantly more expensive (e.g., about 10× CPU/memory resulting in high latency due to initialization overhead and queuing delay) than keeping an existing connection alive.

Inter-component Latency Constraint. Many cloud applications comprise multiple components that require communication with each other, for example, in a multi-tier web service, a user request is first routed to a front-end load balancer, then to a mid-tier application server and finally to a back-end database server. Therefore, component migration may increase inter-component delay resulting in increased user-perceived latencies. To reduce the impact, component migration is allowed, as feasible, if the inter-component delay is within a latency threshold ξ:

∀jεJ,∀iεN,∀kεN,i≠k: μ _(i,j)*λ_(k,j) *L _(i,k)≦ξ  (10)

The latency threshold ξ may be modeled more precisely, for example, for application instances that require low-latency communications, the constraint can be modeled as follows (however, this constraint makes the problem non-linear):

∀j,j′ε{app−communication−pairs}:λ_(i,j)λ_(k,j′) L _(i,k)≦ξ

Business Competitiveness Constraint. In some cases, two companies C1, C2 competing with each other to provide similar set of cloud services may have a placement constraint of being hosted in a different physical location than any of their competitors. The intuition is that even if a datacenter location is unavailable, then the competitor service hosted in a different location will still be able to serve customers and generate revenue. This constraint can be modeled as:

∀iεN,∀jεC1,∀j′εC2:λ_(i,j)≠λ_(i,j′)  (11)

Hosting Site Temperature Constraint. The temperature constraint of running each datacenter location checks that if a hosting location is running at least one application instance, then its current temperature should be below its temperature threshold. This constraint can be modeled as follows:

∀iεN,∀jεJ: θ _(i)(t)*λ_(i,j)≦Θ_(i)  (12)

Bandwidth Cost. The bandwidth cost (in $) of migrating application instances (e.g., from location i to k) is modeled as:

$\begin{matrix} {{BwCost} = {\sum\limits_{i \in N}{\sum\limits_{{k \in N},{i \neq k}}{{BC}_{i,k}*\left( {\sum\limits_{j \in J}{\mu_{i,j}*\lambda_{k,j}*s_{j}}} \right)}}}} & (13) \end{matrix}$

Note that in order to remove the constraint (i≠k) in the above equation, the intra-datacenter costs BC_(i,i) can be modeled as zero.

Latency Cost. Similarly, the latency cost (in $) of migrating application instances (e.g., from location i to k) can be modeled as the following:

$\begin{matrix} {{LatCost} = {\sum\limits_{i \in N}{\sum\limits_{{k \in N},{i \neq k}}{\sum\limits_{j \in J}{\mu_{i,j}\lambda_{k,j}{Z\left( {s_{j},c_{j},i,k} \right)}}}}}} & (14) \end{matrix}$

Note that the latency can be modeled as a cost function to be minimized as below (e.g., datacenter and application operators may be willing to pay SLA penalties at times to save on operational costs) or as a constraint to be satisfied as in the alternative problem formulation described below.

The cost function Z to convert latency to a $ cost can be described in terms of SLA violation during application migration. A simple cost function can be defined as follows:

$\begin{matrix} {{Z\left( {s_{j},c_{j},i,k} \right)} = \left\{ \begin{matrix} 0 & {{{if}\mspace{14mu} {f\left( {s_{j},c_{j},i,k} \right)}} \leq {Lat}^{SLA}} \\ \rho & {{if}\mspace{14mu} \left( {{Lat}^{SLA} < {f\left( {s_{j},c_{j},i,k} \right)}} \right.} \\  & \left. {{f\left( {s_{j},c_{j},i,k} \right)} \leq {3*{Lat}^{SLA}}} \right) \\ \infty & {otherwise} \end{matrix} \right.} & (15) \end{matrix}$

where ρ is a fixed value or a dynamic value (e.g., proportional to overshoot of Lat^(SLA)) denoting the SLA violation penalty.

Energy Cost. The energy cost of running all application instances across the hosting locations can be modeled as:

$\begin{matrix} {{EnergyCost} = {{\sum\limits_{i \in N}{{EC}_{i}(t)}} = {\sum\limits_{i \in N}\left( {\sum\limits_{m = 1}^{Q}{\left( {\sum\limits_{q \in Q}{{u_{i,q,m}(t)}*{{EC}_{i,q}(t)}}} \right)*{d_{i,m}(t)}}} \right)}}} & (16) \end{matrix}$

Finally, the energy, bandwidth, and latency costs can be combined into a single cost metric.

Cost($)=αEnergyCost+βBwCost+δLatCost  (17)

Note that the weights α, β, γε[0, 1] are assigned to give relative importance to each cost component; for normalization α+β+γ=1.

Constraint on Variable Values. The constraints on power used per source q (u_(i,q,m)(t)), and length of partitioning intervals (d_(i,m)) variables can be modeled as follows:

$\begin{matrix} {{{\forall{m \in \left\lbrack {1,{Q}} \right\rbrack}}:{{d_{i,m}(t)} \leq \tau}}{{\sum\limits_{m = 1}^{Q}d_{i,m}} = \tau}{{\forall{i \in N}},{\forall{q \in \left\lbrack {1,{Q}} \right\rbrack}},{{\forall{m \in \left\lbrack {1,{Q}} \right\rbrack}}:{{u_{i,q,m}(t)} \leq {P_{i,q}(t)}}}}{{\forall{i \in N}},{{{\forall{m \in \left\lbrack {1,{Q}} \right\rbrack}}:{\sum\limits_{q \in Q}{u_{i,q,m}(t)}}} = {\sum\limits_{j \in J}{\lambda_{i,j}*p_{j}}}}}{{\forall{i \in {N:{\sum\limits_{q \in Q}{\sum\limits_{m = 1}^{Q}{{u_{i,q,m}(t)}*{d_{i,m}(t)}}}}}}} = {\sum\limits_{j \in J}{\lambda_{i,j}*p_{j}*\tau}}}} & (18) \end{matrix}$

Note that supply≧demand constraints are satisfied on both energy and power at each time instant. In particular, for power, since the power availability does not change between any partition interval, it suffices to check at the boundaries,

∀iεN,∀mε[1,|Q|]:Σ _(qεQ) u _(i,q,m)(t)=Σ_(jεJ)λ_(i,j) *p _(j)

Using these formulations, the objective function can be defined as a constrained Mixed Integer Linear Programming (MILP) of minimizing the total cost of running application instances across hosting datacenters.

Objective: MIN Cost($)  (19)

subject to the constraints (3), (4), (5), (6), (7), (10), (11), (12), (18) which is solved using a standard ILP (integer linear programming) solver on the above formulation.

Computing d_(i,m)(t): To make the optimization problem linear, the optimal setting of the length of partitioning intervals can be pre-computed: d_(i,m)(t); t is omitted from representation unless otherwise specified.

The intuition is at each hosting site i, to first sort into a list the end times T_(i,q), until which power from source q is available,

T _(i,1) ′≦T _(i,2) ′≦ . . . ≦T _(i,Q)′(mε[1,|Q|])

Next, split the time window (interval) τ into |Q| partition intervals with the boundaries set by the T′_(i,q). FIG. 5 illustrates a sorted sequence of power sources based on end time of source power availability. Note that all fluctuations of power availability only occur at the boundaries of these intervals. Then, set the lengths of these intervals based on the boundaries. FIG. 6 illustrates an algorithm that computes optimum partition intervals.

Alternative Problem Formulation. A related variant of the problem is to minimize the total cost of running all application instances across hosting datacenters subject to service level agreement (SLA) as the upper bound on migration latency of an instance between two hosting locations (e.g., the upper bound on migration latency Lat^(SLA) is at most 500 ms),

Objective: MIN Cost($)=αEnergyCost+βBwCost  (20)

subject to the constraints (3), (4), (5), (6), (7), (10), (11), (12), (18) and the latency constraint (8) that migrating an application instance is feasible if it is below an SLA threshold,

∀jεJ,iεN,kεN,i≠k: μ _(i,j)*λ_(k,j) *f(s _(j) ,c _(j) ,i,k)≦Lat ^(SLA)  (21)

which is solved using a standard ILP solver on the above formulation.

Following is an example implementation.

Input/Output: The inputs employed are defined in the system model for both hosting locations and application instances. The output is values of λ_(i,j)λiεN, jεJ denoting optimal placement of application instances across locations, and u_(i,q,m)∀iεN, jεJ, qεQ, mε[1, |Q|] denoting the optimal power usage from each energy source during each of the |Q| partition intervals. These decisions are translated into migration and shutdown servers as previously described.

Initial Placement: The current placement of instances can be initialized to locations before running the optimization framework, that is, set u_(i,j), ∀iεN, jεJ.

The periodic time interval τ for running the controller (application management component 122) can be set such that (1) the system has sufficient time (not too short) to transition from one stable state to another (all migration of instances and state transitions are completed before again optimizing the placement) and (2) the cost function has not significantly changed (not too long) that most placement decisions soon become suboptimal. Ideally, interval τ can be set so that dynamic power pricing only incurs a modest cost increase over the optimal cost, before running the controller again.

-   -   Dynamic Power Fluctuation. Since the power availability of any         energy source, such as grid and solar, may change dramatically         over a short period of time, the algorithm recalculates the         energy terms for the affected locations and if the energy         available is insufficient (violates equation (7) to run         instances hosted at that location until the next time to run the         optimization controller), either the global optimization can be         run at that time for all the datacenter locations, or simply the         requisite number of instances moved from the affected locations         to under-utilized locations while meeting the constraints on         hosting capacity, temperature, and available energy at the new         locations as well as the affected locations (until energy needed         falls below available capacity).     -   Dynamic Temperature Fluctuation. Similarly, if the temperature         at a hosting site risks (or as predicted) overshooting its         threshold, the algorithm can follow the above procedure by         either proactively re-running the global optimization, or         migrating instances from affected locations to other locations         while meeting the constraints on hosting capacity, temperature,         and available energy at the new locations.     -   Dynamic Power Pricing Fluctuation. In case the energy prices         vary significantly over a short period of time, the global         optimization can be re-run or the affected locations ranked by         decreasing cost of available energy and migrate instances in the         following manner: from locations with highest energy cost to         locations with least energy cost, while meeting the constraints         on hosting capacity, temperature, and available energy at the         new locations.

Bandwidth cost versus energy cost savings. To balance the trade-off between bandwidth cost and energy savings, a cost-benefit approach can be employed where an instance is only migrated when its bandwidth cost can be amortized over n execution periods of savings in the energy cost. The weighing constants α, β can be set accordingly.

Integrating caching with application execution. To maximize availability under limited capacity, application architects and cloud operators may integrate caching with application execution by running a small number of cache servers at places with expensive power, and (relatively) large number of application servers at locations with cheap power.

Speculative prefetching of bulk data or background replication. To support dynamic application migration, persistent user data and application state may be speculatively transferred to potential hosting locations as a background service.

Minimizing impact on user interactiveness. To reduce the impact of user-perceived latency due to multiple migrations of the interacting application, a count of the number of times an instance has been migrated may be maintained and input as a constraint to limit migrations of instances to below that threshold in a given time period.

Following is a description of extensions to the disclosed optimization architecture that can be employed.

Relaxing the assumptions. The assumptions, fixed power and fixed price during time window τ, and power availability from each source starting time t, can be relaxed. FIG. 7 illustrates that each power source may have different start and end times of availability for power pricing. Partitioning of the time window τ can be based on start time and end time of power availability. It is between these times during which the associated power pricing remains fixed and power from a source may be available (non-continuous) over different time intervals during time window τ.

In this model, a power source is represented as a four tuple: (start time, end time, watt power intensity, and price). Availability of a single power source during different time intervals can be treated as different (virtual) power sources. Then, partition the time period τ by marking boundaries at start and end times for each virtual power source, based on time instance when the value of watt power intensity of an energy source gets changed, based on time instance when the cost of watt power intensity of an energy source gets changed, and then compute the length of partitioning intervals as done previously.

Look ahead to multiple time steps. The look ahead for the optimization can be extended from a single step to multiple (say l) look-ahead steps by increasing the interval τ. Note that the dynamic pricing and availability of energy is already accounted in the formulation of a single look-ahead step.

Reducing impact on user latency. Dynamic application placement to distant geographic locations may result in increased user-perceived latency or turn-around time of batch jobs. One approach is to input a constraint that application migration may only be allowed to a subset of locations (e.g., based on geographic zone or availability zone) so that the impact on user latency is small. Another solution is to incorporate latency constraints between user and applications, and between application components (e.g., grains) in the optimization framework.

Dynamic bandwidth pricing. Dynamic pricing of wide-area network bandwidth cost can also be included in the optimization framework.

Delay-tolerant job execution. For background services such as web crawl jobs, or applications that can tolerate delayed execution (e.g., temporarily suspended and resumed at a later time) the jobs can be scheduled (start time, end time, resume time) to run when operating costs are minimum (e.g., low demand time periods such as evenings across different time zones) or executing at a limited/reduced scale at different times to reduce operating costs.

Regarding delay-tolerant execution, an alternative embodiment is to include dynamic pricing of running application instances when customers have flexibility in when the associated applications can run, for example, in cloud hosting services. A benefit of dynamic pricing is that large pools of resources can be made available to applications when needed.

Fine-grained allocation model. To support fine-grained resource allocation in utility computing infrastructures (e.g., allow users to allocate standard, high memory, or high CPU instances, or small, medium (2× CPU), large (4× CPU), and extra-large (8× CPU)), the hosting capacity H_(i) of location i can be specified in these units and constraints added on instances hosted on a given resource granularity can only be migrated to the same resource granularity (or higher) at a different location with spare capacity.

FIG. 8 illustrates an intelligent power control system 800 for hosting sites. The hosting site 104 includes servers 802 (as computing elements), a data collector 804 that collects data related to the servers 802, and a sensor collector 806 that reads hosting site parameters such as temperature, power consumption, and so on. The output of the data collector 804 and sensor collector 806 is passed as server instrumentation data to a data processing engine 808.

The functionality described herein and associated with the hosting site 104 also applies to a second hosting site 818, that includes servers 820 (as computing elements), a data collector 822 that collects data related to the servers 820, and a sensor collector 824 that reads hosting site parameters such as temperature, power consumption, and so on. The output of the data collector 822 and sensor collector 824 is passed as server instrumentation data to the data processing engine 808. The second hosting site 818 has an associated simulator 826 that performs similarly to the simulator 204.

The data processing engine 808 sends raw data along {circle around (1)} to a datacenter UI 810 for use viewing and interaction. The data processing engine 808 also sends data event notifications along {circle around (2)} to the decision component 206 (a decision engine).

The decision component 206 sends decision output along {circle around (3)} to the datacenter UI 810 for presentation. The decision component 206 also sends power state change decisions and responses along {circle around (4)} to a power state actuator 814. The power state actuator 814 sends power state change execution along {circle around (5)} to the hosting site 104 and along {circle around (5)} to the second hosting site 818. The decision component 206 also sends VM or application grain (instance) migration decisions and responses along {circle around (6)} to a management API 816. The management API 816 sends grain migration execution along {circle around (7)} to the hosting site 104 and along {circle around (7)}* to the second hosting site 818. The datacenter UI 810 interfaces to the simulators (204 and 826) to make adjustments to power variables at the simulators (204 and 826).

The data processing engine 808 receives all the data in the system 800, and then aggregates and correlates the data before passing it to the decision component 206. The data collector 804, the datacenter sensor collector 806 and the simulator (e.g., power and cost) 204 all pass data points to the data processing engine 808. Similarly, the data collector 822, the datacenter sensor collector 824 and the simulator (e.g., power and cost) 826 all pass data points to the data processing engine 808.

The following description details the how the data is passed to the data processing engine 808, what data will be passed and the queries, which will be to aggregate and correlate the data and how the data will be passed to the decision component 206 (an intelligent power controller). The sensor collectors (806 and 824) collect server power data (for each of the servers being used) and total power (for each unit being used).

The decision component 206 is the decision-making entity that takes the data coming from the data processing engine 808, reasons over the data and makes a decision on what each server's power state should be. The decision component 206 contains the following configuration data: base memory usage of the management API runtime, number of active servers, decision interval (in milliseconds), UI update interval (in milliseconds), file location where to hold data shared with UI application, base power consumption of the network of datacenters, the datacenters being controlled, the servers in each datacenter being controlled, communications channel for a directory service, TCP channel information for the power state actuator 814, and the TCP channel information for the datacenter UI 810.

The simulator 204 (and simulator 826) can collect historical parameters and realtime energy parameters (data points), not limited to: power, the available solar power (watt power intensity and duration), used solar power for last time interval (watt power intensity and duration), available grid power (watt power intensity and duration), used grid power for last time interval (watt power intensity and duration), available backup power (watt power intensity and duration), used backup for last time interval (watt power intensity and duration), unit cost, power cost ($/kWh) for different sources, and network bandwidth cost ($/kB) between it and one or more other datacenters, Lat^(SLA), for example. The basic functionality of the simulator 204 (and simulator 826) is to calculate each of the above data points at the configured time intervals and send the data to the data processing engine 808. The simulator 204 (and simulator 826) then sends outputs for every configured time interval for each of the above data points.

The following are respective inputs into the simulators (204 and 826): total power drawn by the datacenter (arrives in regular intervals); weather (a discrete set of weather states such as cloudy, partially cloudy, and not cloudy; time of day (a discrete set of times of day such as dawn, morning, noon, afternoon, dusk, night; grid power availability (the percent of the max grid power that is available at any time interval); pricing historical data and models of different power sources, and input location for weather, time of day and grid power availability. These inputs can come either from a file or over the TCP channel. This method allows for changing between receiving these inputs through the TCP channel versus reading from a simulation file. If there is a change from the file to the TCP channel and then back to the file then the file will pickup exactly as it left off. If a simulation file is not passed in the command line arguments then this command is ignored.

The power state actuator 814 provides the execution engine for the power state decisions on datacenter servers (802 and 820) by the decision component 206. The power state actuator 814 provides the following functionality: takes power state decisions and executes power state changes associated with these decisions; manages any retries necessary to move a node to the correct power state; and, exposes the current power state for servers managed by the power state actuator.

In addition to the power state actuator 814, a lightweight power state agent runs on each managed server that allows the power state actuator 814 to remotely turn off, put to sleep, and to hibernate, a server. The power state actuator 814 also performs verification to ensure the power state of the server(s) being controlled.

Included herein is a set of flow charts representative of exemplary methodologies for performing novel aspects of the disclosed architecture. While, for purposes of simplicity of explanation, the one or more methodologies shown herein, for example, in the form of a flow chart or flow diagram, are shown and described as a series of acts, it is to be understood and appreciated that the methodologies are not limited by the order of acts, as some acts may, in accordance therewith, occur in a different order and/or concurrently with other acts from that shown and described herein. For example, those skilled in the art will understand and appreciate that a methodology could alternatively be represented as a series of interrelated states or events, such as in a state diagram. Moreover, not all acts illustrated in a methodology may be required for a novel implementation.

FIG. 9 illustrates a computer-implemented optimization method in accordance with the disclosed architecture. At 900, multiple hosting sites are received that run application instances to process workload. At 902, data related to realtime energy parameters associated with each hosting site and energy sources for the hosting sites is tracked. At 904, data related to realtime computing resources associated with available computing elements of the hosting sites is tracked. At 906, the data is reasoned over to output optimization decisions. At 908, application instances are automatically relocating between the hosting sites based on the optimization decisions. Although illustrated as a single iteration, in practice, the flow can return to 900 from 908 to represent continuous processing.

FIG. 10 illustrates further aspects of the method of FIG. 9. Each of the blocks represents a single step that can be added to the method represented by the flow chart of FIG. 9. At 1000, the data further includes service level agreements that are reasoned over and application instances are relocated between the hosting sites based on the service level agreements. At 1002, the data further includes cost associated with network bandwidth and network latencies between the hosting sites that are reasoned over. At 1004, the optimization decisions output are based on renewable and non-renewable energy sources. At 1006, the optimization decisions are output based on dynamic variations in energy prices temporarily and geographically. At 1008, the availability and cost of energy sources at a specific time is predicted based on learned information that includes historical energy availability data and future event notifications. At 1010, the availability of hosting compute elements at different sites is predicted.

FIG. 11 illustrates further aspects of the method of FIG. 9. At 1100, application instances are migrated between datacenters based on integration of optimization decisions with a language runtime mechanism or virtual machine migration. At 1102, application-state and user-data are replicated at different hosting sites based on request redirection of incoming user requests. At 1104, execution of application instances is managed according to different times or at a reduced scale at different times based on at least one of delayed execution or temporary suspension and resumption of execution.

As used in this application, the terms “component” and “system” are intended to refer to a computer-related entity, either hardware, a combination of software and tangible hardware, software, or software in execution. For example, a component can be, but is not limited to, tangible components such as a processor, chip memory, mass storage devices (e.g., optical drives, solid state drives, and/or magnetic storage media drives), and computers, and software components such as a process running on a processor, an object, an executable, module, a thread of execution, and/or a program. By way of illustration, both an application running on a server and the server can be a component. One or more components can reside within a process and/or thread of execution, and a component can be localized on one computer and/or distributed between two or more computers. The word “exemplary” may be used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects or designs.

Referring now to FIG. 12, there is illustrated a block diagram of a computing system 1200 that executes the optimization framework in accordance with the disclosed architecture. In order to provide additional context for various aspects thereof, FIG. 12 and the following description are intended to provide a brief, general description of the suitable computing system 1200 in which the various aspects can be implemented. While the description above is in the general context of computer-executable instructions that can run on one or more computers, those skilled in the art will recognize that a novel embodiment also can be implemented in combination with other program modules and/or as a combination of hardware and software.

The computing system 1200 for implementing various aspects includes the computer 1202 having processing unit(s) 1204, a computer-readable storage such as a system memory 1206, and a system bus 1208. The processing unit(s) 1204 can be any of various commercially available processors such as single-processor, multi-processor, single-core units and multi-core units. Moreover, those skilled in the art will appreciate that the novel methods can be practiced with other computer system configurations, including minicomputers, mainframe computers, as well as personal computers (e.g., desktop, laptop, etc.), hand-held computing devices, microprocessor-based or programmable consumer electronics, and the like, each of which can be operatively coupled to one or more associated devices.

The system memory 1206 can include computer-readable storage (physical storage media) such as a volatile (VOL) memory 1210 (e.g., random access memory (RAM)) and non-volatile memory (NON-VOL) 1212 (e.g., ROM, EPROM, EEPROM, etc.). A basic input/output system (BIOS) can be stored in the non-volatile memory 1212, and includes the basic routines that facilitate the communication of data and signals between components within the computer 1202, such as during startup. The volatile memory 1210 can also include a high-speed RAM such as static RAM for caching data.

The system bus 1208 provides an interface for system components including, but not limited to, the system memory 1206 to the processing unit(s) 1204. The system bus 1208 can be any of several types of bus structure that can further interconnect to a memory bus (with or without a memory controller), and a peripheral bus (e.g., PCI, PCIe, AGP, LPC, etc.), using any of a variety of commercially available bus architectures.

The computer 1202 further includes machine readable storage subsystem(s) 1214 and storage interface(s) 1216 for interfacing the storage subsystem(s) 1214 to the system bus 1208 and other desired computer components. The storage subsystem(s) 1214 (physical storage media) can include one or more of a hard disk drive (HDD), a magnetic floppy disk drive (FDD), and/or optical disk storage drive (e.g., a CD-ROM drive DVD drive), for example. The storage interface(s) 1216 can include interface technologies such as EIDE, ATA, SATA, and IEEE 1394, for example.

One or more programs and data can be stored in the memory subsystem 1206, a machine readable and removable memory subsystem 1218 (e.g., flash drive form factor technology), and/or the storage subsystem(s) 1214 (e.g., optical, magnetic, solid state), including an operating system 1220, one or more application programs 1222, other program modules 1224, and program data 1226.

The one or more application programs 1222, other program modules 1224, and program data 1226 can include the entities and components of the system 100 of FIG. 1, the entities and components of the system 200 of FIG. 2, the entities of the hosting site model 208 of FIG. 3, the entities of the application instances model 210 of FIG. 4, the listing and interval computing represented by the charts of FIGS. 5 and 7, the algorithm 600 of FIG. 6, the system 800 of FIG. 8, and the methods represented by the flowcharts of FIGS. 9-11, for example.

Generally, programs include routines, methods, data structures, other software components, etc., that perform particular tasks or implement particular abstract data types. All or portions of the operating system 1220, applications 1222, modules 1224, and/or data 1226 can also be cached in memory such as the volatile memory 1210, for example. It is to be appreciated that the disclosed architecture can be implemented with various commercially available operating systems or combinations of operating systems (e.g., as virtual machines).

The storage subsystem(s) 1214 and memory subsystems (1206 and 1218) serve as computer readable media for volatile and non-volatile storage of data, data structures, computer-executable instructions, and so forth. Such instructions, when executed by a computer or other machine, can cause the computer or other machine to perform one or more acts of a method. The instructions to perform the acts can be stored on one medium, or could be stored across multiple media, so that the instructions appear collectively on the one or more computer-readable storage media, regardless of whether all of the instructions are on the same media.

Computer readable media can be any available media that can be accessed by the computer 1202 and includes volatile and non-volatile internal and/or external media that is removable or non-removable. For the computer 1202, the media accommodate the storage of data in any suitable digital format. It should be appreciated by those skilled in the art that other types of computer readable media can be employed such as zip drives, magnetic tape, flash memory cards, flash drives, cartridges, and the like, for storing computer executable instructions for performing the novel methods of the disclosed architecture.

A user can interact with the computer 1202, programs, and data using external user input devices 1228 such as a keyboard and a mouse. Other external user input devices 1228 can include a microphone, an IR (infrared) remote control, a joystick, a game pad, camera recognition systems, a stylus pen, touch screen, gesture systems (e.g., eye movement, head movement, etc.), and/or the like. The user can interact with the computer 1202, programs, and data using onboard user input devices 1230 such a touchpad, microphone, keyboard, etc., where the computer 1202 is a portable computer, for example. These and other input devices are connected to the processing unit(s) 1204 through input/output (I/O) device interface(s) 1232 via the system bus 1208, but can be connected by other interfaces such as a parallel port, IEEE 1394 serial port, a game port, a USB port, an IR interface, etc. The I/O device interface(s) 1232 also facilitate the use of output peripherals 1234 such as printers, audio devices, camera devices, and so on, such as a sound card and/or onboard audio processing capability.

One or more graphics interface(s) 1236 (also commonly referred to as a graphics processing unit (GPU)) provide graphics and video signals between the computer 1202 and external display(s) 1238 (e.g., LCD, plasma) and/or onboard displays 1240 (e.g., for portable computer). The graphics interface(s) 1236 can also be manufactured as part of the computer system board.

The computer 1202 can operate in a networked environment (e.g., IP-based) using logical connections via a wired/wireless communications subsystem 1242 to one or more networks and/or other computers. The other computers can include workstations, servers, routers, personal computers, microprocessor-based entertainment appliances, peer devices or other common network nodes, and typically include many or all of the elements described relative to the computer 1202. The logical connections can include wired/wireless connectivity to a local area network (LAN), a wide area network (WAN), hotspot, and so on. LAN and WAN networking environments are commonplace in offices and companies and facilitate enterprise-wide computer networks, such as intranets, all of which may connect to a global communications network such as the Internet.

When used in a networking environment the computer 1202 connects to the network via a wired/wireless communication subsystem 1242 (e.g., a network interface adapter, onboard transceiver subsystem, etc.) to communicate with wired/wireless networks, wired/wireless printers, wired/wireless input devices 1244, and so on. The computer 1202 can include a modem or other means for establishing communications over the network. In a networked environment, programs and data relative to the computer 1202 can be stored in the remote memory/storage device, as is associated with a distributed system. It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers can be used.

The computer 1202 is operable to communicate with wired/wireless devices or entities using the radio technologies such as the IEEE 802.xx family of standards, such as wireless devices operatively disposed in wireless communication (e.g., IEEE 802.11 over-the-air modulation techniques) with, for example, a printer, scanner, desktop and/or portable computer, personal digital assistant (PDA), communications satellite, any piece of equipment or location associated with a wirelessly detectable tag (e.g., a kiosk, news stand, restroom), and telephone. This includes at least Wi-Fi (or Wireless Fidelity) for hotspots, WiMax, and Bluetooth™ wireless technologies. Thus, the communications can be a predefined structure as with a conventional network or simply an ad hoc communication between at least two devices. Wi-Fi networks use radio technologies called IEEE 802.11x (a, b, g, etc.) to provide secure, reliable, fast wireless connectivity. A Wi-Fi network can be used to connect computers to each other, to the Internet, and to wire networks (which use IEEE 802.3-related media and functions).

Referring now to FIG. 13, there is illustrated a schematic block diagram of a computing environment 1300 that performs optimization in accordance with the disclosed architecture. The environment 1300 includes one or more client(s) 1302. The client(s) 1302 can be hardware and/or software (e.g., threads, processes, computing devices). The client(s) 1302 can house cookie(s) and/or associated contextual information, for example.

The environment 1300 also includes one or more server(s) 1304. The server(s) 1304 can also be hardware and/or software (e.g., threads, processes, computing devices). The servers 1304 can house threads to perform transformations by employing the architecture, for example. One possible communication between a client 1302 and a server 1304 can be in the form of a data packet adapted to be transmitted between two or more computer processes. The data packet may include a cookie and/or associated contextual information, for example. The environment 1300 includes a communication framework 1306 (e.g., a global communication network such as the Internet) that can be employed to facilitate communications between the client(s) 1302 and the server(s) 1304.

Communications can be facilitated via a wire (including optical fiber) and/or wireless technology. The client(s) 1302 are operatively connected to one or more client data store(s) 1308 that can be employed to store information local to the client(s) 1302 (e.g., cookie(s) and/or associated contextual information). Similarly, the server(s) 1304 are operatively connected to one or more server data store(s) 1310 that can be employed to store information local to the servers 1304.

What has been described above includes examples of the disclosed architecture. It is, of course, not possible to describe every conceivable combination of components and/or methodologies, but one of ordinary skill in the art may recognize that many further combinations and permutations are possible. Accordingly, the novel architecture is intended to embrace all such alterations, modifications and variations that fall within the spirit and scope of the appended claims. Furthermore, to the extent that the term “includes” is used in either the detailed description or the claims, such term is intended to be inclusive in a manner similar to the term “comprising” as “comprising” is interpreted when employed as a transitional word in a claim. 

1. A computer-implemented optimization system having computer readable media that store executable instructions executed by a processor, comprising: multiple hosting sites that run application instances to handle workload, the hosting sites operate subject to realtime energy parameters, availability and pricing of energy sources, and availability of computing elements; and an application placement component that automatically relocates application instances between hosting sites based on changes in the energy parameters, the availability of the energy sources, and the availability of the computing elements.
 2. The system of claim 1, wherein the hosting sites are modeled according to at least one of hosting capacity, energy available per source per site at a specific time in terms of watt power intensity and duration, energy cost per source per site at the specific time, network latency between sites, bandwidth capacity between sites, bandwidth cost per byte between sites, available renewable and non-renewable energy sources, availability of hosting compute elements at different sites, length of partition intervals at the specific time, temperature per site, or temperature threshold for each site.
 3. The system of claim 1, wherein the application instances are modeled according to at least one of CPU usage and memory footprint size per instance, number of network connections maintained by an instance, power footprint per instance, or latency threshold for migrating an instance between two sites.
 4. The system of claim 1, wherein the availability of an energy source is computed based on predicted power per site for a specific time and predicted time until which energy is available per site for a specific time.
 5. The system of claim 1, wherein the application placement component makes decisions based on minimizing energy cost and bandwidth cost per migration, meeting service level agreement requirements or including latency information in computation of cost.
 6. The system of claim 1, wherein the cost pricing of an energy source is computed based on energy per watt-hour cost per site for a specific time and availability of an energy source is computed based on power used per site during intervals in a time window.
 7. The system of claim 1, wherein the application placement component relocates application instances based on results of a simulator model.
 8. The system of claim 1, further comprising a learning component that learns information of the pricing and availability of an energy source based on historical energy availability data and future event notifications, the learned information applied to enhance a prediction of pricing, watt power intensity, and time duration, until which power is available per site at a specific time.
 9. A computer-implemented optimization system having computer readable media that store executable instructions executed by a processor, comprising: multiple hosting sites that run application instances to handle workload, the hosting sites are managed according to data that includes realtime energy parameters, availability of renewable and non-renewable energy sources, and available computing elements; a decision component that reasons over the data and outputs optimization decisions associated with the hosting sites; and an application placement component that automatically relocates application instances between hosting sites based on the power optimization decisions.
 10. The system of claim 9, wherein the optimization decisions are based on at least one of minimizing monetary costs, minimizing impact on user interactiveness, maximizing longterm availability, maximizing use of renewable resources, minimizing carbon footprint and pollutant emission due to electricity generation and environmental impact, or balancing bandwidth cost and energy cost.
 11. The system of claim 9, wherein the decision component reasons over the data that includes application instance information related to at least one of CPU usage and memory footprint size per instance, number of network connections maintained by an instance, power footprint per instance, SLAs on hosting of application instances, or latency threshold for migrating an instance between two sites.
 12. The system of claim 9, wherein the availability of an energy source is computed based on at least one of predicted power per site for a specific time, predicted time until which energy is available per site for a specific time, energy per watt-hour cost per site for a specific time, or energy used per site during an application partitioning interval.
 13. The system of claim 9, further comprising a learning component that learns information of the pricing and availability of an energy source based on historical energy availability data and future event notifications, the learned information applied to enhance a prediction of pricing, watt power intensity, and time duration, until which power is available per site at a specific time.
 14. A computer-implemented optimization method executed by a processor, comprising: receiving multiple hosting sites that run application instances to process workload; tracking data related to realtime energy parameters associated with each hosting site and energy sources for the hosting sites; tracking data related to realtime computing resources associated with available computing elements of the hosting sites; reasoning over the data to output optimization decisions; and automatically relocating application instances between the hosting sites based on the optimization decisions.
 15. The method of claim 14, further comprising reasoning over the data that further includes service level agreements and relocating application instances between the hosting sites based on the service level agreements.
 16. The method of claim 14, further comprising reasoning over the data that further includes cost associated with network bandwidth and network latencies between the hosting sites.
 17. The method of claim 14, further comprising outputting the optimization decisions based on renewable and non-renewable energy sources.
 18. The method of claim 14, further comprising outputting the optimization decisions based on dynamic variations in energy prices temporarily and geographically.
 19. The method of claim 14, further comprising predicting pricing and availability and cost of energy sources at a specific time based on learned information that includes historical energy pricing and availability data and future event notifications.
 20. The method of claim 14, further comprising migrating application instances between datacenters based on integration of optimization decisions with a language runtime mechanism or virtual machine migration.
 21. The method of claim 14, further comprising replicating application-state and user-data at different hosting sites based on request redirection of incoming user requests.
 22. The method of claim 14, further comprising managing execution of application instances according to different times or at a reduced scale at different times based on at least one of delayed execution or temporary suspension and resumption of execution. 